package com.greendao.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.xuxin.baby.database.CartBean;
import com.xuxin.baby.database.HistoryBean;
import com.xuxin.baby.database.SearchBean;

import com.greendao.dao.CartBeanDao;
import com.greendao.dao.HistoryBeanDao;
import com.greendao.dao.SearchBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig cartBeanDaoConfig;
    private final DaoConfig historyBeanDaoConfig;
    private final DaoConfig searchBeanDaoConfig;

    private final CartBeanDao cartBeanDao;
    private final HistoryBeanDao historyBeanDao;
    private final SearchBeanDao searchBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        cartBeanDaoConfig = daoConfigMap.get(CartBeanDao.class).clone();
        cartBeanDaoConfig.initIdentityScope(type);

        historyBeanDaoConfig = daoConfigMap.get(HistoryBeanDao.class).clone();
        historyBeanDaoConfig.initIdentityScope(type);

        searchBeanDaoConfig = daoConfigMap.get(SearchBeanDao.class).clone();
        searchBeanDaoConfig.initIdentityScope(type);

        cartBeanDao = new CartBeanDao(cartBeanDaoConfig, this);
        historyBeanDao = new HistoryBeanDao(historyBeanDaoConfig, this);
        searchBeanDao = new SearchBeanDao(searchBeanDaoConfig, this);

        registerDao(CartBean.class, cartBeanDao);
        registerDao(HistoryBean.class, historyBeanDao);
        registerDao(SearchBean.class, searchBeanDao);
    }
    
    public void clear() {
        cartBeanDaoConfig.clearIdentityScope();
        historyBeanDaoConfig.clearIdentityScope();
        searchBeanDaoConfig.clearIdentityScope();
    }

    public CartBeanDao getCartBeanDao() {
        return cartBeanDao;
    }

    public HistoryBeanDao getHistoryBeanDao() {
        return historyBeanDao;
    }

    public SearchBeanDao getSearchBeanDao() {
        return searchBeanDao;
    }

}
